<template>
    <div class="list-container">
        <el-date-picker type="month"
                    class="w-130px"
                    v-model="dateMonth"
                    :picker-options="pickerOptions"></el-date-picker>
        <div>
            <div>
                <span>借出款</span>
                <span>{{asset}}</span>
            </div>
            <div>
                <span>资产</span>
                <span>{{asset.allAssetAmount}}</span>
            </div>
            <div>
               <span>负债</span>
               <span>{{asset.allLiabilitiesAmount}}</span>
            </div>
            <div>
                <span>净资产</span>
                <span>{{asset.netAsset}}</span>
            </div>
            <div>
                <span>收入</span>
                <span>{{asset.allIncomeAmount}}</span>
            </div>
            <div>
                <span>支出</span>
                <span>{{asset.expenditure}}</span>
            </div>
            <div>
                <span>净资产变化</span>
                <span>{{asset.netAssetChange}}</span>
            </div>
        </div>
    </div>
</template>
<script>
import { greaterThanEqualsAfter30Days } from '@/assets/utils/commonUtil'
import { querySummary } from '@/assets/api/index.js'
export default {
  data () {
    return {
      dateMonth: new Date(),
      asset: {},
      pickerOptions: {
        disabledDate: greaterThanEqualsAfter30Days
      }
    }
  },
  mounted () { this.getAsset() },
  methods: {
    getAsset () {
      querySummary({ date: this.dateMonth }).then(res => {
        this.asset = res.data
      })
    }
  }
}
</script>
